﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace ufida.u9.ait.OpenAPIBListUIModel
{
	[Serializable]
	public partial class OpenAPIBListUIModelModel : UIModel
	{
		#region Constructor
		public OpenAPIBListUIModelModel() : base("OpenAPIBListUIModel")
		{
			InitClass();
			this.SetResourceInfo("1895778a-9766-42f2-8e04-a195b1af6663");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private OpenAPIBListUIModelModel(bool isInit) : base("OpenAPIBListUIModel")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new OpenAPIBListUIModelModel(false);
		}
		#endregion
		#region member
		#region views
		private AITLogView viewAITLog;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public AITLogView AITLog
		{
			get { return (AITLogView)this["AITLog"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewAITLog = new AITLogView(this);
			this.viewAITLog.SetResourceInfo("9412559b-b5c9-4af2-a6ce-ff3e4d34ad79");
			this.Views.Add(this.viewAITLog);			

			
		}

		public override string AssemblyName
		{
			get { return "ufida.u9.ait.openui"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class AITLogView : UIView
	{
		#region Constructor
		public AITLogView(IUIModel model) : base(model,"AITLog","UFIDA.U9.AIT.OpenAPIBE.AITLog", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private AITLogView():base(null,"AITLog","UFIDA.U9.AIT.OpenAPIBE.AITLog", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new AITLogView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public AITLogDefaultFilterFilter DefaultFilter
		{
			get { return (AITLogDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","1b082c56-a744-4b4d-adad-973c65785cde");


			this.CurrentFilter = new AITLogDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new AITLogRecord(builder);
		}
		#endregion

		#region new method
		public new AITLogRecord FocusedRecord
		{
			get { return (AITLogRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new AITLogRecord AddNewUIRecord()
		{	
			return (AITLogRecord)base.AddNewUIRecord();
		}
		public new AITLogRecord NewUIRecord()
		{	
			return (AITLogRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class AITLogRecord : UIRecord
	{
		#region Constructor
		public AITLogRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private AITLogView uiviewAITLog
		{
			get { return (AITLogView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new AITLogRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewAITLog.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewAITLog.FieldID);
			}
			set{
				this[this.uiviewAITLog.FieldID] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class AITLogDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public AITLogDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private AITLogDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new AITLogDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}